<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@page
	import="b1w1nn1ng.crossf1t.gui.*,java.util.*,java.sql.*,b1w1nn1ng.crossf1t.business.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> Goals </title>
<jsp:include page="/detectBrowser.jsp" />	
</head>
<body>

	<%
		User user = (User) session.getAttribute("user");
		session.setAttribute("user", user);
	%>

	<div id="container">
		<jsp:include page="/navbar.jsp" />
		<h1>Goals</h1>
		<hr />
		
		<h2>Currently active goals:</h2>
		<div id="goalsAlignCenter">
		<%
		boolean setActiveGoals = false;
		if(user.getGoals().size() == 0)
			out.println("You do not currently have any goals set. Add one below!<br /><br />");
		else {
			out.println("<ul>");
			for(String g : user.getGoals()) {
				out.println("<li>"+g+
					" <a href=\"goalDelete.jsp?goal="+g+"\" class=\"changeButton2\" >Remove</a>"+
					"</li>");
				setActiveGoals = true;
			}
			out.println("</ul>");
			if(!setActiveGoals)
				out.println("You do not currently have any goals set. Add one below!<br /><br />");
		}
		%>
		</div>
		
		<form action="goalAdd.jsp" method="post">
			<h2>Add a new goal:</h2><input type="text" style="line-height: 50px; width:400px" name="goal">
			<br>	
			<input type="submit" value="Add Goal" name="Add Goal" style="font-size:36px;">
		</form>
		
	</div>
</body>
</html>